/*******************************************************************************
 * IDateUpdater.h
 *
 * Copyright (c) 2012, Varuna L Amachi. All rights reserved.
 *
 * This program/library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This program/library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301  USA
 ******************************************************************************/

#ifndef IDATEUPDATER_H
#define IDATEUPDATER_H

/////Later we will use forword declarations for as much classes as possible

#include <QList>
#include <QString>
#include <QDate>

#include "core/model/StoredObject.h"
#include "core/model/StoredAudio.h"
#include "core/model/SavedPlaylist.h"
#include "core/model/StoredMediaObject.h"



namespace Tanyatu
{
namespace DataSource
{
class TANYATU_CORE_EXPORT IDataUpdater
{
protected:
    IDataUpdater() { /*NOTHING TO DO*/ }

public:

    virtual bool add( Model::StoredObject *stored ) = 0;

    virtual bool update( Model::StoredObject *stored ) = 0;

    virtual bool remove( Model::StoredObject *stored ) = 0;

    virtual bool add( QList< Model::StoredObject *> &objList ) = 0;

    virtual bool update( QList< Model::StoredObject *> &objList ) = 0;


    virtual bool remove( QList< Model::StoredObject *> &stored ) = 0;

    virtual bool savePlaylist( QString playlistName,
                               QList< QString > &ids ) = 0;

//    virtual bool appendTrackToPlaylist( QString playlistName,
//                                        QString trackId,
//                                        int index ) = 0;

    virtual bool addHistory( QString itemId, QDateTime time ) = 0;

    //Settings framework will come later, this for sample :P
    virtual bool updateSetting( QString key, QVariant value ) = 0;

    virtual bool clearAudioLibrary() = 0;

    virtual bool clearVideoLibrary() = 0;

    virtual bool clearHistory() = 0;

    virtual bool clearHistory( QDateTime &from ) = 0;

    virtual bool clearPlaylist( QString playlistName ) = 0;

    virtual bool removePlaylist( QString playlistName ) = 0;

    virtual bool removeAudioTracks( QList< QString > &trackIds ) = 0;

    virtual bool removeAudioTrack( QString trackId ) = 0;

    virtual bool removeVideoTrack( QString trackId ) = 0;

    virtual bool removeVideoTracks( QList< QString > &trackId) = 0;

    virtual bool removeArtist( QString artistName ) = 0;

    virtual bool removeAlbum( QString albumId ) = 0;

    virtual bool removeHistoryItem( QString trackId ) = 0;

    virtual bool removeFromHistory( QList< QString > &trackIds ) = 0;

    virtual bool updateRating( Model::StoredMediaObject *stored ) = 0;

    virtual bool updatePlayCount( Model::StoredMediaObject *stored ) = 0;

    virtual bool updateTags( Model::StoredMediaObject *stored ) = 0;

    virtual bool saveCurrentPlaylist(
            const QList< Tanyatu::Model::MediaItem *> &list ) = 0;

    virtual ~IDataUpdater() { /*NOTHING TO DO*/ }
};
}
}


#endif // IDATEUPDATER_H
